@extends('web.frame_layout')
<?php $parent_menu = "购物商城"; $menu_selected = "我的订单";?>
<link rel="stylesheet" href="{{asset('web/css/withdrawal-record.css')}}">
{{--<link rel="stylesheet" href="{{asset('web/css/popup.css')}}">--}}
<link rel="stylesheet" href="{{asset('web/css/express.css')}}">
@section('content')
    <div class="m-right-nr">
        <div>
            <h2><span>我的订单</span></h2>
        </div>
        <div class="m-txList">
            <div class="m-txList-title">
                <form action="{{route('web.orders')}}" action="get" id="txjl_search">
                    <select name="type">
                        <option value="1" selected>编号搜索</option>
                        {{--<option value="2">用户名搜索</option>--}}
                    </select>
                    <div>
                        <input type="text" name="search" placeholder="请输入编号进行精准查询">
                        <button>搜索</button>
                    </div>
                </form>
            </div>
            <div class="table-responsive">
                <table class="table">
                    <tr>
                        <th>订单编号</th>
                        <th>购买商品信息</th>
                        <th>金额</th>
                        <th>省市县</th>
                        <th>详细街道地址</th>
                        <th>联系方式</th>
                        <th>订单备注</th>
                        <th>下单时间</th>
                        {{--<th>发货时间</th>--}}
                        <th>订单状态</th>
                    </tr>

                    @foreach($orders as $o)
                        <tr class="active">
                            <td>{{$o->no}}</td>
                            <td>{!! $o->good_info !!}</td>
                            <td>{{$o->price}}</td>
                            <td>
                                {{\App\Models\MArea::find($o->province)['name']}}
                                {{\App\Models\MArea::find($o->city)['name']}}
                                {{\App\Models\MArea::find($o->county)['name']}}
                            </td>
                            <td>{{$o->addr}}</td>
                            <td>{{$o->tel}}</td>
                            <td>{{$o->detail==''?'无':$o->detail}}</td>
                            <td>{{date('Y-m-d H:i',$o->create_time)}}</td>
{{--                            <td>{{empty($o->send_time) ? '暂无' : date('Y-m-d H:i:s',$o->send_time)}}</td>--}}
                            <td>
                                @if($o->status == \App\Models\MOrder::$STATUS_PAY_OK)
                                    <a href="###" class="shz">待发货</a>
                                @elseif($o->status == \App\Models\MOrder::$STATUS_PAY_SEND)
                                    <a href="###" class="yjj">已发货</a>
                                    <a onclick="getExpressData({{$o->id}})" class="express" style="background: darkgreen;cursor:pointer;">查看物流</a>
                                @elseif($o->status == \App\Models\MOrder::$STATUS_PAY_END)
                                    <a href="###" class="ydk">已完成</a>
                                @endif
                            </td>
                        </tr>
                    @endforeach

                </table>
                @include('web.coms.fenye')
            </div>
        </div>
    </div>

    @include('web.coms.express-info-dialog')
@endsection

@section('footer')
@endsection